using System;
using UnityEngine;

[RequireComponent(typeof(tk2dUIColorUpDown))]
public class BMThemeColorUpDown : BMThemeBase
{
	public override Color Color
	{
		get
		{
			return default(Color);
		}
		set
		{
		}
	}

	public override ThemeItem[] ThemeItems
	{
		get
		{
			if (this.themeItems == null)
			{
				return null;
			}
			return Array.ConvertAll<ThemeItemColorUpDown, ThemeItem>(this.themeItems, (ThemeItemColorUpDown item) => item);
		}
		set
		{
			if (value == null)
			{
				this.themeItems = null;
			}
			else
			{
				this.themeItems = Array.ConvertAll<ThemeItem, ThemeItemColorUpDown>(value, (ThemeItem item) => item as ThemeItemColorUpDown);
			}
		}
	}

	protected override void Awake()
	{
		base.Awake();
		this.colorUpDown = base.GetComponent<tk2dUIColorUpDown>();
	}

	public override bool Change(string themeName)
	{
		if (!base.Change(themeName))
		{
			return false;
		}
		ThemeItemColorUpDown themeItemColorUpDown = base.GetThemeItem(themeName) as ThemeItemColorUpDown;
		if (themeItemColorUpDown == null)
		{
			return false;
		}
		this.colorUpDown.UpColor = themeItemColorUpDown.color;
		this.colorUpDown.downColor = themeItemColorUpDown.downColor;
		this.colorUpDown.SendMessage("OnChangeTheme", null, SendMessageOptions.DontRequireReceiver);
		return true;
	}

	[HideInInspector]
	public ThemeItemColorUpDown[] themeItems;

	private tk2dUIColorUpDown colorUpDown;
}
